include <stdio.h>
#include <unistd.h>
#include <string.h>

int main(){
  char bar[101];
  char *label="|/-\\";
  memset(bar,0,sizeof(bar));
  for(int i = 0; i <= 100; i++)
  {
    printf("[%c][%-100s][%-3d%%]\r",label[i%4],bar,i);
    fflush(stdout);
    bar[i]='#';
    usleep(50000);
  }
  printf("\n");
  return 0;
}
